package com.ruku.service;

import com.bean.*;
import com.ruku.mapper.RuKuMapper;
import com.sun.org.apache.regexp.internal.RE;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service

public class RuKuService {
    @Autowired
    RuKuMapper ruKuMapper;
    public List<WmsTCustomer> getCusMess(String shuru){
        return ruKuMapper.getCusMess(shuru);
    }

    //根据输入货主姓名获取customerID
    public WmsTCustomer getCustID(String custName){
        return ruKuMapper.getCustID(custName);
    }

    //办理入库插入wms_t_bill表
    public void insertRuku(WmsTBill wmsTBill){
        ruKuMapper.insertRuku(wmsTBill);
    }

    //显示所有信息
    public List<WmsTBill> selectAll(){
        return ruKuMapper.selectAll();
    }

    public List<WmsTStore> selectStore(){
        return ruKuMapper.selectStore();
    }
    public List<WmsTSite> selectSite(String storeID){
        return ruKuMapper.selectSite(storeID);
    }
    //装盘明细
    public List<WmsTBillDetails> selectBillDetail(String billId){
        return  ruKuMapper.selectBillDetail(billId);
    }

    //根据billId更新billState为0
    public void UpdateBill(String billID){
        ruKuMapper.UpdateBill(billID);
    }

    //批量删除装盘明细
    public void deleteMany(String detailsID){
        ruKuMapper.deleteMany(detailsID);
    }

    //费用结算更新到数据库
    public void feiyong(WmsTBill wmsTBill){
        ruKuMapper.feiyong(wmsTBill);
    }

    //费用结算更新到数据库
    public void rukuqueren(String billID){
        ruKuMapper.rukuqueren(billID);
    }


    //入库单查询
    public List<Map<String, Object>> bill(String start, String end, String custName, String billID){
        return  ruKuMapper.bill(start,end,custName,billID);
    }

    //入库单信息
    public WmsTBill selectbills(String billID){
        return ruKuMapper.selectbills(billID);
    }

    //删除入库单信息
    public void deleteMess(String billID){
        ruKuMapper.deleteMess(billID);
    }

    //根据custName获取custID
    public WmsTCustomer selectCustID(String custName){
        return ruKuMapper.selectCustID(custName);
    }

    //更新入库单信息
    public void updateMess(String billDate,String billEditTime,double billFeeTruckage,String billID,String customerID){
        ruKuMapper.updateMess(billDate,billEditTime,billFeeTruckage,billID,customerID);
    }

    //计算总费用
    public void jisuan(String billID){
        ruKuMapper.jisuan(billID);
    }

}
